﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GoogleMapUpdate.aspx.cs" Inherits="ModernShopping.User.GoogleMapUpdate" %>
<%@ Register Src="~/WebUserControls/UCCountDown.ascx" TagName="Countdown" TagPrefix="MyUserControls" %>
<%@ Register Src="~/WebUserControls/UCPopup.ascx" TagName="Popup" TagPrefix="MyUserControls" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Danh sách các cửa hàng</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta charset="utf-8" />
    <link href="../Css/GoogleMap.css" rel="stylesheet" />
    <link href="../Css/ModernShopping.css" rel="stylesheet" />
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true&libraries=places,geometry"></script>
    <script type="text/javascript" src="../Scripts/ContextMenu.js"></script>
    <script type="text/javascript" src="../Scripts/GoogleMap.js"></script>
    <script type="text/javascript" src="../Scripts/ajaxLoader.js"></script>
    <script type="text/javascript" src="../Scripts/jquery-1.9.1.js"></script>

    <script>
        var geocoder;
        var map;
        var myStyles = [{
            featureType: "poi",
            elementType: "labels.icon",
            stylers: [{ visibility: "off" }]
        }];
        function initialize() {
            var mapOptions = {
                center: new google.maps.LatLng(10.84993423147865, 106.771693564418),
                zoom: 17,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                draggableCursor: 'crosshair',
                disableDoubleClickZoom: true,
                mapMaker: true

            };
            geocoder = new google.maps.Geocoder();
            map = new google.maps.Map(document.getElementById('map_canvas'),
              mapOptions);
            createContextMenuForMarker();
            initAutocomplete();
            google.maps.event.addListenerOnce(map, 'tilesloaded', function () {
                if (MyJson != null) {
                    displayMarkers();
                }
            });
        }
        google.maps.event.addDomListener(window, 'load', initialize);

    </script>

</head>
<body>
    <div id="panel" style="margin-left: -500px">
        <input id="searchTextField" class="textbox" type="textbox" style="width: 400px;" placeholder="Bạn muốn tìm gì?" />
        <input type="button" class="button" style="min-width: 100px;" onclick="codeAddress()" value="TÌM" />
    </div>
    <div id="map_canvas" style="float: left; width: 74%; height: 99%; border: 1px solid #2c7c00;"></div>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <table style="width: 25%;">
            <tr>
                <td style="text-align: center;">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                    <asp:Button ID="btnSave" CssClass="button" runat="server" Text="CẬP NHẬT" OnClick="btnSave_Click" OnClientClick="saveMarkerJobect();" />
                    <ajaxToolkit:ConfirmButtonExtender ID="cbe" runat="server"
                        TargetControlID="btnSave"
                        ConfirmText="Bạn có chắc là muốn lưu lại?"
                        OnClientCancel="CancelClick" />
                </td>
            </tr>
            <tr>
                <td style="text-align: left;">
                    <input type="hidden" id="markerObjects" runat="server" />
                    <div id="div_marker" runat="server" style="width: 100%; display: block; overflow-y: scroll; max-height: 500px;" />
                </td>
            </tr>
        </table>
        <MyUserControls:Countdown runat="server" ID="Countdown" />
        <MyUserControls:Popup runat="server" ID="MyPopup" />
    </form>
</body>
</html>
